/*
 * Copyright 2007 - The JDPF Project Team (http://www.jdpf.org) 
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); 
 * you may not use this file except in compliance with the License. 
 * You may obtain a copy of the License at 
 * 
 * http://www.apache.org/licenses/LICENSE-2.0 
 * 
 * Unless required by applicable law or agreed to in writing, software 
 * distributed under the License is distributed on an "AS IS" BASIS, 
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and 
 * limitations under the License. 
 */
package org.jdpf.core.kernel.elements;


/**
 * An abstract net arc. It manages the connections of the arc with the previous
 * and the following element. 
 * 
 * @author Paolo Ciccarese
 */
public class AbstractArc extends AbstractNetElement {

	/**
	 * The place where the abstract arc is from/to
	 */
	private Place place;
	/**
	 * The transition the abstract arc is from/to
	 */
	private ITransition transition;

	/**
	 * Full abstract input arc constructor
	 * @param id			The unique id of the abstract arc
	 * @param place			The provenance place of the abstract arc
	 * @param transition	The target transition of the abstract arc
	 */
	public AbstractArc(String id, Place fromPlace, ITransition toTransition) {
		super(id);
		this.place = fromPlace;
		this.transition = toTransition;
	}
	
	/**
	 * Full abstract output arc constructor
	 * @param id			The unique id of the abstract arc
	 * @param transition	The provenance transition of the abstract arc
	 * @param place			The target place of the abstract arc
	 */
	public AbstractArc(String id, ITransition fromTransition, Place toPlace) {
		super(id);
		this.place = toPlace;
		this.transition = fromTransition;
	}
	
	/**
	 * Id constructor
	 * @param id
	 */
	public AbstractArc(String id){
		super(id);
	}
	
	/**
	 * Return the place the abstract arc is from/to
	 * @return The linked place
	 */
	public Place getPlace() {
		return place;
	}

	/**
	 * Return the transition the abstract arc is from/to
	 * @return The linked transition
	 */
	public ITransition getTransition() {
		return transition;
	}
}
